#include "DioDrv.h"
#include "Port_Cfg.h"

Dio_LevelType DioDrv_ReadChannel(Dio_ChannelType ChannelId)
{

}

void DioDrv_WriteChannel(Dio_ChannelType ChannelId, Dio_LevelType Level)
{
    if( PTA_NUMS > ChannelId )//PTA range, 0~13
    {
        PINS_DRV_WritePin(PTA, (ChannelId), Level);
    }
    else if( (PTA_NUMS + PTB_NUMS) > ChannelId )//PTB range, 14~27
    {
        PINS_DRV_WritePin(PTB, (ChannelId-PTA_NUMS), Level);
    }
    else if( (PTA_NUMS + PTB_NUMS + PTC_NUMS) > ChannelId )//PTC range, 28~45
    {
        PINS_DRV_WritePin(PTC, (ChannelId-(PTA_NUMS + PTB_NUMS)), Level);
    }
    else if( (PTA_NUMS + PTB_NUMS + PTC_NUMS + PTD_NUMS) > ChannelId )//PTD range, 46~62
    {
        PINS_DRV_WritePin(PTD, (ChannelId-(PTA_NUMS + PTB_NUMS + PTC_NUMS)), Level);
    }
    else if( (PTA_NUMS + PTB_NUMS + PTC_NUMS + PTD_NUMS + PTE_NUMS) > ChannelId )//PTE range, 63~74
    {
        PINS_DRV_WritePin(PTE, (ChannelId-(PTA_NUMS + PTB_NUMS + PTC_NUMS + PTD_NUMS)), Level);
    }
    else
    {
    }
}
